
#include <iostream>
#include "Implement_bai6_06.h"


using namespace std;

CStudent::CStudent(){
	mssv = 0;
	for(int i = 0; i < 5; i++)
		diemArr[i] = 0;
	diemNums = 0;
}

void CStudent::nhapMSSV(){
	int t;
	cout<<"enter MSSV : "; cin>>t;
	this->mssv = t;
}

void CStudent::upDateDiem(float d, int &dNums){
	if(dNums < 5){		
		dNums++;
		this->diemArr[dNums -1] = d;
	}	
}

float CStudent::diemTrungBinh(){
	float sumDiem = 0;
	for(int i = 0; i < diemNums; i++){
		sumDiem += diemArr[i];
	}
	return sumDiem/diemNums;
}

void CStudent::xuatMssvDiemTB(){
	cout<<"MSSV : "<<mssv<<endl;
	cout<<"Diem Trung Binh : "<<diemTrungBinh()<<endl;
}
